#include "gemv.h"

#include <arm_sve.h>

#include <stdexcept>

void gemv(const float* A, const float* x, float* y, const size_t m,
          const size_t n) {
  for (size_t i = 0; i < m; i++) {
    float acc = 0.0f;
    for (size_t j = 0; j < n; j++) {
      acc += A[i * n + j] * x[j];
    }
    y[i] = acc;
  }
}

void gemv_sve(const float* A, const float* x, float* y, const size_t m,
              const size_t n) {
  // SVE implementation is not yet complete.
  throw std::runtime_error("SVE gemv implementation is not yet complete.");
}
